Explicitly implement PartialEq for ObjectName to satisfy clippy
authorFelix Krull <f_krull@gmx.de>
Fri, 12 Oct 2018 21:25:31 +0000 (23:25 +0200)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:53 +0000 (12:53 -0400)
rust-bindings/rust/libostree/src/object_name.rs

index 463a06069a14ec232ad1262b508201ee19444de8..e64949236aea8b2a5a5202ff4a39692da9525c42 100644 (file)
@@ -14,7 +14,7 @@ fn hash_object_name(v: &glib::Variant) -> u32 {
     unsafe { ffi::ostree_hash_object_name(v.to_glib_none().0 as glib_ffi::gconstpointer) }
 }
 
-#[derive(PartialEq, Eq, Debug)]
+#[derive(Eq, Debug)]
 pub struct ObjectName {
     variant: glib::Variant,
     checksum: String,
@@ -66,3 +66,9 @@ impl Hash for ObjectName {
         state.write_u32(hash_object_name(&self.variant));
     }
 }
+
+impl PartialEq for ObjectName {
+    fn eq(&self, other: &ObjectName) -> bool {
+        self.checksum == other.checksum && self.object_type == other.object_type
+    }
+}